package com.sc.nft.admin.rpc;

import com.sc.nft.admin.request.IdRequest;
import com.sc.nft.service.MallActivityShareService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author liGen
 * @version 1.0
 * @date 2023/12/18 11:21 上午
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/rpc/activity/share")
@Api(tags = "分享购活动RPC接口")
public class MallActivityShareRpc {

    public final MallActivityShareService mallActivityShareService;

    @ApiOperation(value = "分享购活动下架", notes = "分享购活动下架", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/disable", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result disable(@Valid @RequestBody IdRequest idRequest) {
        mallActivityShareService.disableByActivityId(idRequest.getId());
        return Result.success();
    }
}
